package domain;

public class ClientMessage {
	MessageType messageType;
	String SenderCompID;
	Integer ClOrdID;
	Integer sessionRejectReason;
	String Text;
	Double Price;
	Integer Amount;
	TypeOfOrder orderType;
	Stock stock;
	OrderStatus ordStatus;
	Integer closedAmount;

	
	public ClientMessage(Order ord) {
		SenderCompID = ord.getOwner().getName();
		Price = ord.getPrice();
		Amount = ord.getAmount();
		orderType = ord.getType();
		stock = ord.getStock();
		ordStatus = ord.getStatus();
		closedAmount = ord.getClosedAmount();
		ClOrdID = ord.getCliOrdID();
	}
	public ClientMessage() {}
	public Integer getClosedAmount() {
		return closedAmount;
	}

	public void setClosedAmount(Integer closedAmount) {
		this.closedAmount = closedAmount;
	}

	public OrderStatus getOrdStatus() {
		return ordStatus;
	}

	public void setOrdStatus(OrderStatus ordStatus) {
		this.ordStatus = ordStatus;
	}

	public Stock getStock() {
		return stock;
	}

	public void setStock(Stock stock) {
		this.stock = stock;
	}

	public TypeOfOrder getOrderType() {
		return orderType;
	}

	public void setOrderType(TypeOfOrder orderType) {
		this.orderType = orderType;
	}

	public Integer getAmount() {
		return Amount;
	}

	public void setAmount(Integer amount) {
		Amount = amount;
	}

	public Double getPrice() {
		return Price;
	}

	public void setPrice(Double price) {
		Price = price;
	}

	public String getText() {
		return Text;
	}

	public void setText(String text) {
		Text = text;
	}

	public Integer getSessionRejectReason() {
		return sessionRejectReason;
	}

	public void setSessionRejectReason(Integer sessionRejectReason) {
		this.sessionRejectReason = sessionRejectReason;
	}

	public String getSenderCompID() {
		return SenderCompID;
	}

	public void setSenderCompID(String senderCompID) {
		SenderCompID = senderCompID;
	}

	public Integer getClOrdID() {
		return ClOrdID;
	}

	public void setClOrdID(Integer clOrdID) {
		ClOrdID = clOrdID;
	}

	public MessageType getMessageType() {
		return messageType;
	}

	public void setMessageType(MessageType messageType) {
		this.messageType = messageType;
	}

	public String toString() {
		return new String("35=" + messageType + "|49=" + SenderCompID + "|373="
				+ sessionRejectReason + "|58=" + Text + "|44="+Price+"|38="+Amount
				+ "|54="+orderType+"|55="+stock+"|39="+ordStatus
				+"|14="+closedAmount+"|11="+ClOrdID+"|40="+"2");
	}

}
